<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true" namespace="ThorMVR.ClassModels" assembly="ThorMVR">
  <class name="ThorMVR.ClassModels.GeralEmpresas,ThorMVR" table="geral_empresas" lazy="true">

    <!-- Primary Key(s) -->
    <id name="_id" column="id" type="Int32" unsaved-value="0">
      <generator class="assigned"/>
    </id>

    <!-- Properties -->
    <property column="RazaoSocial" type="String" name="_razaosocial" length="50" />
    <property column="Apelido" type="String" name="_apelido" length="50" />
    <property column="CPF_CNPJ" type="String" name="_cpf_cnpj" length="50" />
    <property column="Grupo" type="Int32" name="_grupo" not-null="true" />
    <property column="Personalidade" type="String" name="_personalidade" length="20" />
    <property column="Logradouro" type="String" name="_logradouro" length="20" />
    <property column="Endereco" type="String" name="_endereco" length="150" />
    <property column="Numero" type="String" name="_numero" length="20" />
    <property column="Complemento" type="String" name="_complemento" length="50" />
    <property column="Bairro" type="String" name="_bairro" length="30" />
    <property column="CEP" type="String" name="_cep" length="10" />
    <property column="CodIBGE" type="String" name="_codibge" not-null="true" length="10" />
    <property column="Municipio" type="String" name="_municipio" length="50" />
    <property column="UF" type="String" name="_uf" length="2" />
    <property column="SiglaPais" type="String" name="_siglapais" length="3" />
    <property column="Tel_ddd" type="Int32" name="_tel_ddd" />
    <property column="Tel_Principal" type="String" name="_tel_principal" length="10" />
    <property column="Fax_ddd" type="Int32" name="_fax_ddd" />
    <property column="Fax_Principal" type="String" name="_fax_principal" length="10" />
    <property column="NaturezaJuridica" type="String" name="_naturezajuridica" not-null="true" length="10" />
    <property column="InscricaoMunicipal" type="String" name="_inscricaomunicipal" length="50" />
    <property column="InscricaoEstadual" type="String" name="_inscricaoestadual" length="50" />
    <property column="CNAE" type="String" name="_cnae" not-null="true" length="10" />
    <property column="ContribuinteIPI" type="String" name="_contribuinteipi" length="50" />
    <property column="InscricaoRural" type="String" name="_inscricaorural" length="10" />

    <!-- One-To-Many relations -->
    <bag name="_listGeralEmpresasIe" generic="true" inverse="true" cascade="all-delete-orphan" lazy="true">
      <key column="id_empresa"/>
      <one-to-many class="ThorMVR.ClassModels.GeralEmpresasIe,ThorMVR" />
    </bag>
  </class>
</hibernate-mapping>
